package com.fs.groupSeven.Dao;

import com.fs.groupSeven.pojo.*;
import com.fs.groupSeven.pojo.Class;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StudentDao {

    //根据学院id查询班级名称
    List<Class> queryClassList(Integer collegeId);

    //分页显示学生信息
    List<Student> queryStudentByPage();

    //添加一个学生信息
    int addOne(Student student);


    Student getOneById(Integer studentId);

    int updateStudent(Student student);

    int delStudentByStudentId(Integer studentId);

    List<Student> searchStudentsByPage(@Param("startNum")Integer startNum,@Param("pageSize") Integer pageSize, @Param("searchValue") String searchValue);

    List<Student> searchStudentsByAll(@Param("searchValue")String searchValue);

    List<Student> queryStudentsByClassId(Integer classId);

    List<Student> queryStudentSomeInformationByStuNum(Integer stuNum);

    //添加成绩
    int addGrade(@Param("studentId")Integer studentId, @Param("subjectName")String subjectName, @Param("usualscore") Integer usualscore,@Param("examscore") Integer examscore, @Param("finalscore") Integer finalscore);

    List<Grade> queryGradeTable(@Param("classId")Integer classId,@Param("subjectName")String subjectName);

    Student getOneGradeByGradeId(Integer gradeId);

    //根据gradeId和科目名称判断成绩是否已经存在
    Student queryGradeIdByStudentIdAndSubjectName(@Param("subjectName")String subjectName,@Param("studentId") Integer studentId);

    int addGradeByGrade(Grade grade);

    int editGradeByGradeId(@Param("gradeId")Integer gradeId,@Param("usualscore") Integer usualscore,@Param("examscore") Integer examscore,@Param("finalscore") Integer finalscore);

    List<Student> searchStudentGradeByAll(@Param("searchValue")String searchValue);

    List<Class> showClassesByIndex();

    List<Subject> querySubjectList(Integer collegeId);

    List<College> selCollegeNameByCollegeId();
}
